import request from '@/utils/request';

// 查询已确认列表
export function getConfirmedList(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/confirmedUrl',
		method: 'post',
		data: data,
	});
}

// 查询黑名单列表
export function getBlackList(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/blackList',
		method: 'post',
		data: data,
	});
}

// 查询未确认列表
export function getUnconfirmed(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/unconfirmedUrl',
		method: 'post',
		data: data,
	});
}

// 分页查询url映射列表
export function getUrlMappingPage(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/management/unconfirmedUrl/getUrlMappingPage',
		method: 'POST',
		data: data,
	});
}

// 查询系统
export function getSystemOptions(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/system/it/resource/config/getSystemOptions',
		method: 'get',
		params: query,
	});
}

// 查询网端
export function getSegmentOptions(id: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/system/it/resource/config/getSegmentOptions/' + id,
		method: 'get',
	});
}
// 确认服务资源
export function confirmResource(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/unconfirmedUrl/confirmResource',
		method: 'post',
		data: data,
		headers: {
			version: 'dengfazhu',
		},
	});
}
// 再次确认服务资源
export function confirmResourceAgain(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/confirmedUrl/confirmResourceAgain',
		method: 'post',
		data,
	});
}
// 删除已确认服务资源
export function deleteConfirmedResource(data: string): ApiPromise<ApiResponse> {
	return request({
		url: '/management/confirmedUrl/delete/' + data,
		method: 'delete',
	});
}
// 删除服务资源黑名单
export function deleteBlackList(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/blackList/deleteBlackList',
		method: 'post',
		data: data,
		headers: {
			version: 'dengfazhu',
		},
	});
}

// 加入黑名单
export function addBlackList(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/unconfirmedUrl/addBlackListBatch',
		method: 'post',
		data: data,
	});
}

// 批量加入黑名单
export function addBlackListBatch(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/system/it/resource/config/addBlackListBatch',
		method: 'post',
		data: data,
	});
}
